package com.gran.mydemo.ownui.myactivity;

import com.replaceapkdemo.R;
import com.gran.mydemo.adapters.GallyAdapter;
import com.gran.mydemo.adapters.gridAdapter;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.Gallery;
import android.widget.GridLayout.LayoutParams;
import android.widget.GridView;
import android.widget.ListView;

public class GridViewSimple extends Activity{
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		log("onCreate");
		super.onCreate(savedInstanceState);
		setContentView(R.layout.gridlayout);
		initView();
	}
	
	void initView(){
		Integer[] im=new Integer[6];
		im[0]=R.drawable.flower;
		im[1]=R.drawable.fourrect;
		im[2]=R.drawable.heart;
		im[3]=R.drawable.quadrangle;
		im[4]=R.drawable.star;
		im[5]=R.drawable.rect;
		
		GridView gridv=(GridView) findViewById(R.id.gridv);
		
		gridAdapter adapter=new gridAdapter(GridViewSimple.this,im,gridv);
		gridv.setAdapter(adapter);
	}
	
	
	@Override
	protected void onResume() {
		log("onResume");
		super.onResume();
	}
	@Override
	protected void onStart() {
		log("onStart");
		super.onStart();
	}
	@Override
	protected void onRestart() {
		log("onRestart");
		super.onRestart();
	}
	@Override
	protected void onPause() {
		log("onPause");
		super.onPause();
	}
	@Override
	protected void onStop() {
		log("onStop");
		super.onStop();
	}
	
	@Override
	protected void onDestroy() {
		log("onDestroy");
		super.onDestroy();
	}
	
	void log(String msg){
		 Log.d("GridView.java", "executed=GridView========="+msg);
	 }

}
